<div class="expander">
    <a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a>
</div>
</div>

<script type="text/javascript">
$(document).ready(function() {
	// Initialize navgoco with default options
	$(".nbrightbuy_catmenu").navgoco({
		caretHtml: '<i class="fa fa-chevron-circle-down"></i>', // http://fontawesome.io/icons/
		accordion: [<tag type="if" function="settings" key="treebehaviour" testvalue="True" display="true" displayelse="false" />], // Because the script requires lower case
		openClass: 'open',
		save: false,
		slide: {
			duration: 200,
			easing: 'swing' // linear or swing
		},
		// Add Active class to clicked menu item
		onClickAfter: function(e, submenu) {
			//e.preventDefault();
			$('.nbrightbuy_catmenu').find('li').removeClass('active');
			var li =  $(this).parent();
			var lis = li.parents('li');
			li.addClass('active');
			lis.addClass('active');
		},
	});

	$("#collapseAll").click(function(e) {
		e.preventDefault();
		$(".nbrightbuy_catmenu").navgoco('toggle', false);
	});

	$("#expandAll").click(function(e) {
		e.preventDefault();
		$(".nbrightbuy_catmenu").navgoco('toggle', true);
	});
});
</script>
